<?php

namespace app\admin\model;

use think\Model;


class UserSetting extends Model
{

    

    

    // 表名
    protected $name = 'user_setting';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;

    // 定义时间戳字段名
    protected $createTime = false;
    protected $updateTime = false;
    protected $deleteTime = false;

    // 追加属性
    protected $append = [
        'fond_size_text',
        'speed_text',
        'is_hear_text',
        'is_follow_text'
    ];
    

    
    public function getFondSizeList()
    {
        return ['1' => __('Fond_size 1'), '2' => __('Fond_size 2'), '3' => __('Fond_size 3')];
    }

    public function getSpeedList()
    {
        return ['1' => __('Speed 1'), '2' => __('Speed 2'), '3' => __('Speed 3')];
    }

    public function getIsHearList()
    {
        return ['1' => __('Is_hear 1'), '2' => __('Is_hear 2')];
    }

    public function getIsFollowList()
    {
        return ['1' => __('Is_follow 1'), '2' => __('Is_follow 2')];
    }


    public function getFondSizeTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['fond_size']) ? $data['fond_size'] : '');
        $list = $this->getFondSizeList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getSpeedTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['speed']) ? $data['speed'] : '');
        $list = $this->getSpeedList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getIsHearTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['is_hear']) ? $data['is_hear'] : '');
        $list = $this->getIsHearList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getIsFollowTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['is_follow']) ? $data['is_follow'] : '');
        $list = $this->getIsFollowList();
        return isset($list[$value]) ? $list[$value] : '';
    }




}
